<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateCollectionsTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('collections', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('user_id')->comment('用户ID');
			$table->string('class')->comment('收藏对象: user/article/topic/column');
			$table->integer('class_id')->comment('被收藏对象的ID');
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::drop('collections');
	}
}
